package de.iritgo.skillfull.entity.command;

import org.newdawn.slick.Sound;

import de.iritgo.skillfull.component.visitor.SimpleTextVisitor;
import de.iritgo.skillfull.entity.Command;
import de.iritgo.skillfull.entity.Entity;

public class PlaySoundCommand implements Command 
{
	private boolean done;
	private Sound fx;
	
	public PlaySoundCommand (Sound fx)
	{
		this.fx = fx;
	}

	public String getName ()
	{
		return "PlaySound"; 
	}

	@Override
	public boolean canPerform () 
	{
		return true;
	}

	@Override
	public void perform (int delta) 
	{
		fx.play ();
		done = true;
	}
	
	@Override
	public void stop() 
	{
		done = true;
	}

	public Command getUndoCommand () 
	{
		return null;
	}

	@Override
	public boolean isDone () 
	{
		return done;
	}
}
